package cn.wolfcode.cmis.service.Impl;

import cn.wolfcode.cmis.dao.IEmployeeDAO;
import cn.wolfcode.cmis.dao.lmpl.EmployeeDAOImpl;
import cn.wolfcode.cmis.domain.Employee;
import cn.wolfcode.cmis.qo.PageResult;
import cn.wolfcode.cmis.qo.QueryObject;
import cn.wolfcode.cmis.service.IEmployeeService;

import java.util.List;

public class EmployeeServiceImpl implements IEmployeeService {
    IEmployeeDAO employeeDAO = new EmployeeDAOImpl();

    @Override
    public PageResult<Employee> query(QueryObject qo) {
        int count = employeeDAO.queryForCount(qo);
        List<Employee> list = employeeDAO.queryForList(qo);
        return new PageResult<>(qo.getCurrentPage(), qo.getPageSize(), count, list);
    }


}
